<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>main</title>
</head>
<body>
  <h1>this is main iframe</h1>
  <button type="button" name="button" onclick="javascript:hideSide();">收起侧边栏</button>
  <script src="http://libs.baidu.com/jquery/1.4.2/jquery.min.js"></script>
  <script type="text/javascript">
    var bg = ['#883333','#338833','#333388'];
    var rand = parseInt(Math.random()*3);
    $('body').css('background', bg[rand]);
    function hideSide(){
      // var myframe = parent.document.getElementById('myframe');
      // console.log(myframe);
      // myframe.setAttribute('cols', '0,*');
      var myframe = $('#myframe');
      console.log(myframe);
    }
  </script>
</body>
</html>
